
// Define SudokuUI object if it is not already defined
if (typeof SudokuUI === 'undefined') var SudokuUI = {};

SudokuUI.presets = 
{
	presets : 
		[
			'200105003054000710010203080602807304000000000105309806020701060081000240700402001', 
			'060104050008305600200000001800407006006000300700901004500000002007206900040508070', 
			'850002400720000009004000000000107002305000900040000000000080070017000000000036040', 
			'016400000200009000400000062070230100100000003003087040960000005000800007000006820', 
			'049008605003007000000000030000400800060815020001009000010000000000600400804500390', 
			'760500000000060008000000403200400800080000030005001007809000000600010000000003041', 
			'400000805030000000000700000020000060000080400000010000000603070500200000104000000', 
			'000605000003020800045090270500000001062000540400000007098060450006040700000203000', 
			'409000705000010000006207800200000009003704200800000004002801500000060000905000406', 
			'000010030040070501002008006680000003000302000300000045200500800801040020090020000', 
			'080070030260050018000000400000602000390010086000709000004000800810040052050090070', 
			'000093006000800900020006100000080053006000200370050000002500040001009000700130000', 
			'100000700020000500600380000078000000000609000000000140000025009003000060004000002', 
			'080000094004050300000740081920600000006504900000009067450037000009060800860000050', 
			'480300000000000071020000000705000060000200800000000000001076000300000400000050000'
		],

	init : function ()
	{
		var menu = new yux.SelectMenu('PresetGrids');
		for (var i = 0; i < this.presets.length; i++)
			menu.add(this.presets[i], SudokuUI.presets.generateCallback(this.presets[i], menu));
	},

	generateCallback : function (fixed, menu)
	{
		return function ()
		{
			SudokuUI.controller.loadPuzzle(fixed);
			menu.clearSelection();
		}
	}
}
